<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>

<iframe src="getMemReviewCommonDetail.do?custom_uuid=${custom_uuid}" width="100%"
	frameborder="0" scrolling="no" height="100%"
	onload="javascript:SetCwinHeight(this)"></iframe>
<div style="margin: 20px 0;"></div>
<jiepos:workFlowListTag system_type="t_app_custom_inf"
	system_key="${custom_uuid}" code_tp="REALNAME_AUDIT_ST"></jiepos:workFlowListTag>

<div style="margin: 20px 0;"></div>
<form id="reviewMemForm"  name="reviewMemForm" method="post">
    	<input type="hidden" id="custom_uuid" name="custom_uuid" value="${custom_uuid}"/>
    	<input type="hidden" id="bankcard_uuid" name="bankcard_uuid" value="${appCustomBankEntity.bankcard_uuid}"/>
		<div >
		<span style="font-size: 12px;vertical-align: top;">审核意见</span>
			<textarea name="audit_comments" value="${appWorkFlowTraceEntity.audit_comments}" cols="30" rows="10" maxlength="150"></textarea>
		</div>
</form>

<div style="text-align:center;padding:5px">
	    	<jiepos:buttonDetailTag menuCode="${menuCode}" formId="reviewMemForm" hideBack="true"></jiepos:buttonDetailTag>
	    	<a href="javascript:void(0)" class="easyui-linkbutton btn" iconCls="icon-back" onclick="backList()">返回</a>
</div>
<script>
	function reviewPass(urls){ 
		var audit_comments = $("textarea[name='audit_comments']").val();
		if(audit_comments.length >= 500){
			$.jpmessage.info('审核意见最多输入500字符!');
			return;
		};
		if($("#reviewMemForm").form("validate")){
			$.jpmessage.confirm("确认提交审核吗？", function(result){
				if(result){
					var options ={
	                    url:'<c:url value="../memreview/checkCustomInfo.do"/>',
	                    type:'post',
	                    success:function(data){
	                        if("success"== data){
	                            //表单提交的方法、比如ajax提交
	                            $("#reviewMemForm").attr("action",urls);
	                            document.getElementById("reviewMemForm").submit();
	                        }else if("error" == data){
	                            $.jpmessage.info('该会员已审核!');
	                        }
	                    }
	                };
	                $("#reviewMemForm").ajaxSubmit(options);
				}
			});
		}
	};


function SetCwinHeight(obj) {
	var cwin = obj;
	if (document.getElementById) {
		if (cwin && !window.opera) {
			if (cwin.contentDocument
					&& cwin.contentDocument.body.offsetHeight)
				cwin.height = cwin.contentDocument.body.offsetHeight + 30;
			else if (cwin.Document && cwin.Document.body.scrollHeight)
				cwin.height = cwin.Document.body.scrollHeight + 30;
		}
	}
}

function backModify(urls){
	var audit_comments = $("textarea[name='audit_comments']").val();
	if(audit_comments == null || audit_comments == ""){
		$.jpmessage.info('请填写审核意见!');
		return;
	}
	if(audit_comments.length >= 500){
		$.jpmessage.info('审核意见最多输入500字符!');
		return;
	}
	if($("#reviewMemForm").form("validate")){
		$.jpmessage.confirm("确认退回修改吗？", function(result){
			if(result){
				var options ={
	                url:'<c:url value="../memreview/checkCustomInfo.do"/>',
	                type:'post',
	                success:function(data){
	                	if("error" == data){
	                        $.jpmessage.info('该会员已审核!');
	                    }else {
	                        //表单提交的方法、比如ajax提交
	                        $("#reviewMemForm").attr("action",urls);
	                        document.getElementById("reviewMemForm").submit();
	                    }
	                }
	            };
	            $("#reviewMemForm").ajaxSubmit(options);
			}
		});
	}
};
function backList(){
	window.location.href="<c:url value="/memreview/getMemReviewList.do"/>?menuCode="+menuCodeValue;
}
</script>